<template>
	<div class="main">
		<div class="top">
			<van-nav-bar
			  title="学生评教"
			  left-text="返回"
			  left-arrow
			  @click-left="onClickLeft"
			/>
		</div>
		<div class="head">
			<div class="fanhui" @click="onClickRight"><span>返回</span></div>
			<div class="Finish" ><span>评教问卷</span></div>
		</div>
		<!-- <div class="content">
			<div class="course">课程</div>
			<div class="teacher">教师</div>
		</div> -->
		<van-collapse v-model="activeNames"   >
		  <van-collapse-item v-for="(item,index) in PaperItemCategory" :key="index"  :name="index" >
			<template #title>
						<div @click="getPaperItem(item.paperItemCategoryId)">{{item.paperItemCategoryName}}</div>
					</template>
			<!-- <div class="paper"  v-for="item1 in PaperItem">
				
				<div class="title" >{{item1.paperItemTitle}}({{item1.itemPointValue}})</div>
				<div class="select" >
				<van-radio-group v-model="checked" class="item">
				  <van-radio name="1" icon-size="18px">{{item1.optionA}}</van-radio>
				  <van-radio name="2" icon-size="18px">{{item1.optionB}}</van-radio>
				  <van-radio name="3" icon-size="18px">{{item1.optionC}}</van-radio>
				  <van-radio name="4" icon-size="18px">{{item1.optionD}}</van-radio>
				  <van-radio name="5" icon-size="18px">{{item1.optionE}}</van-radio>
				</van-radio-group></div>
			</div> -->
		  </van-collapse-item>
		 <!-- <van-collapse-item title="标题2" name="2">
		    技术无非就是那些开发它的人的共同灵魂。
		  </van-collapse-item> -->
		</van-collapse>
		<!-- <div class="paper" >
			<div class="title">标题</div>
			<div class="select">
			<van-radio-group v-model="checked" class="item">
			  <van-radio name="1" icon-size="18px">单选框 1</van-radio>
			  <van-radio name="2" icon-size="18px">单选框 2</van-radio>
			  <van-radio name="3" icon-size="18px">单选框 3</van-radio>
			  <van-radio name="4" icon-size="18px">单选框 4</van-radio>
			  <van-radio name="5" icon-size="18px">单选框 5</van-radio>
			</van-radio-group></div>
		</div> -->
	</div>
</template>

<script>
	import {ItemList,PaperItemCategoryList,getPaperItem} from '@/api/pj'
	export default {
		data() {
			return{
				checked:"",
				activeNames:[],
				param:{
					pageNum:1,
					pageSize:10,
					evaluationPaperId:null
				},
				PaperItemCategory:[],
				PaperItemCategoryId:null,
				param1:{
					pageNum:1,
					pageSize:10,
					PaperItemCategoryId:null,
					evaluationPaperId:null
				},
				PaperItem:[],
				index:0,
				names:null,
				activityId:this.$route.query.activityId,
				evaluationId:this.$route.query.evaluationIds
			}
		},
		created() {
			const evaluationPaperId=this.$route.query.index;
			this.param.evaluationPaperId=evaluationPaperId;
			this.getEvaluationPaper();
			// this.getPaperItem();
		},
		methods:{
			onClickLeft(){
				this.$router.push('/')
			},
			onClickRight(){
				this.activityId=this.$activityId;
				console.log(this.activityId)
				if(this.param.evaluationPaperId==null){
					this.$router.push({path:'/pj',query:{index:this.activityId}})
				}else{
					this.$router.push({path:'/Info',query:{index:this.activityId}})
				}
				
			},
			async getEvaluationPaper(){
				const result=await PaperItemCategoryList(this.param)
				if(result.code==200){
					console.log(result)
					this.PaperItemCategory=result.rows;
					
					this.param1.evaluationPaperId=result.rows.evaluationPaperId;
				}
			},
			async getPaperItem(id){
				// console.log(name)
				
				// const result=await getPaperItem(name)
				// if(result.code==200){
				// 	this.PaperItem=result.data
				// 	// const ids=this.index+1;
				// 	// this.index=ids;
				// }
				if(this.evaluationId==null){
					this.$router.push({path:'/paperItem',query:{index:id}})
				}else{
					this.$router.push({path:'/finishItem',query:{index:id,evaluationIds:this.evaluationId}})
				}
				
			},
		}
	}
</script>

<style scoped>
	.head{
		background-color: #0099FF;
		display: flex;
		height: 42px;
		
	}
	.head .fanhui{
		padding-top: 10px;
		padding-left: 10px;
		font-size: 16px;
	}
	.head .Finish{
		padding-top: 5px;
		font-size: 20px;
		padding-left: 120px;
	}
	.content{
		text-align: center;
	}
	.content .course{
		font-size: 20px;
	}
	.content .teacher{
		font-size: 20px;
	}
	.paper{
		padding-left: 3px;
	}
	.paper .title{
		font-size: 20px;
	}
	.paper .select{
		font-size: 18px;
	}
	.van-radio-label-margin{
		margin-top: 3px;
	}
</style>